a = 1
b = 2
fab = 3
sum = 2
while fab < 4000000:
    fab = a + b
    if not fab % 2:
        sum += fab
    a = b
    b = fab
print (sum)